<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'Yii Blog Demo',

    // modules
    'modules'=>array(
        'Core' => array (
            //Sub modules
            'modules' => array(
                'auth'
            ),
        ),
        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'generatorPaths'=>array('Core.extensions.gii.generators'),
            'password'=>'flexicore',
        ),
        'Admin' => array(
        ),
         'User' => array(
        ),
        // -------- begin listing site modules below ---------- //
        'Article' => array(
        ),
    ),

    // preloading 'log' component
    'preload'=>array('log','core'),

    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'Core.components.*'
    ),
    
    'defaultController'=>'post',

    // application components
    'components'=>array(
        'core'=>array(
            'class' => 'Core.extensions.FlexiCore',
            //'FrontendRenderer' => false,
        ),
        'user'=>array(
            'allowAutoLogin'=>true,
        ),
        'authManager' => array(
            'class' => 'FAuthManager',
        ),
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=flexicore',
            'emulatePrepare' => true,
            'enableParamLogging' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ),
        'errorHandler'=>array(
            'class' => 'Core.extensions.base.FErrorHandler',
             //use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
        'urlManager'=>array(
            //'urlFormat'=>'path',
            'rules'=>array(
                'post/<id:\d+>/<title:.*?>'=>'post/view',
                'posts/<tag:.*?>'=>'post/index',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning, trace',
                ),
            ),
        ),
        'cache'=>array(
            'class'=>'system.caching.CDbCache',
            'autoCreateCacheTable'=>true,
            'connectionID'=>'db',
            'cacheTableName'=>'yii_cache',
        ),
        'mail' => array(
            'class' => 'application.modules.Core.extensions.mail.YiiMail',
            'transportType' => 'smtp',
            'transportOptions' => array(
                'host'=>'smtp.gmail.com',
                'username'=>'',
                'password'=>'',
                'port'=>465,
                'encryption'=>'ssl',
            ),
            'logging' => true,
            'dryRun' => false
        ),
    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params'=>require(dirname(__FILE__).'/params.php'),
);